gen2Z(gen)
gen2genZ(gen)
genZ2freq(genZ)
genZ2S(genZ=NULL, reference="F2", nloc=NULL, max.level=NULL,
max.dom=NULL)
genZ2Z(genZ)
genZ2ZS(genZ, reference="F2", max.level=NULL, max.dom=NULL,
threshold=0)
genZ2X(genZ, reference="F2", max.level=NULL, max.dom=NULL)
checkgenZ(genZ, tol=0.0001)
Z2freq(Z)
partialX(genZ, reference="F2", effect)
Sloc(reference="F2", i=NULL, genZ=NULL)
freqmat2Sgenofreqloc(reference="F2", i=NULL, freqmat=NULL, sinv=TRUE)
freqmat2Sgenofreq(nloc, reference="F2", freqmat=NULL, sinv=TRUE)1, 2, 3. Missing data are allowed."F2", "F1",
"Finf". "P1", "P2", "G2A", "UWR" and
"noia" are possible. Default is "F2".".ad").reference="G2A": A vector of length nloc containing allele frequencies such that
freqmat[i]=frequency(allele 1) for locus i.
For referencgen2Z: Transforms a gen data set into a Z matrix that is the data matrix in the regression. The function actually calls sequencially gen2genZ and genZ2Z.
gen2genZ: Transforms a gen matrix into a genZ matrix.genZ2freq: Provides a vector representing the frequency of each genotypic form at each locus. The sum of the frequency is 1 for each locus.
genZ2S: Provides the S matrix (see Alvarez-Castro and Carlborg 2007) for a given reference point. Some reference points are genotypic frequency-dependent ("G2A" and "noia"), and the genZ matrix must be provided. For the others, only the number of loci is necessary.
genZ2Z: Computes the Z matrix from the genotypic probabilities. See Alvarez-Castro and Carlborg 2007 for more details.
genZ2ZS: Computes Z and S matrices at the same time. This is highly efficient when many genotypes are not represented in the dataset. The function returns a list of two elements "zmat" and "smat".
genZ2X: Computes the product of Z and S matrices without building them. This is very efficient when considering only low-level interactions.
checkgenZ: Checks the structure of the genZ matrix.
Z2freq: Computes the multi-locus genotypic frequency over all genotypic combinations.
partialX: Computes the product of Z and S matrices, keeping Z and S as small as possible considering a given effect effect.
Sloc: Provides a 3x3 S matrix, corresponding to one locus. Frequency-dependent reference points will require the genZ matrix and the index of the locus.
freqmat2Sgenofreqloc: Returns the 3x3 S matrix (and inv(S) if sinv=TRUE) for given i, freqmat and reference.
freqmat2Sgenofreq: Returns the 3^nloc x 3^nloc S matrix (and inv(S) if sinv=TRUE) for given freqmat and reference.
linearRegression, multilinearRegression, linearGPmapanalysisset.seed(123456789)
map <- c(0.25, -0.75, -0.75, -0.75, 2.25, 2.25, -0.75, 2.25, 2.25)
names(map) <- genNames(2)
pop <- simulatePop(map, N=500, sigmaE=0.2, type="F2")
gen <- pop[2:3]
genZ <- gen2genZ(gen)
Z <- genZ2Z(genZ)Run the code above in your browser using DataLab